package my;

import java.util.List;

import javax.ejb.Remote;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import org.jboss.ejb3.annotation.Clustered;

@Clustered
@Remote
@Path("/")
// @Consumes(MediaType.APPLICATION_JSON)
// @Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_XML)
@Produces(MediaType.APPLICATION_XML)
public interface ILibrary {

	@GET
	@Path("/books")
	List<Book> getBooks();

	@GET
	@Path("/book/{isbn}")
	Book getBook(@PathParam("isbn") String id);

	@PUT
	@Path("/book/{isbn}")
	Book addBook(@PathParam("isbn") String id, @QueryParam("title") String title);

	@POST
	@Path("/book/{isbn}")
	Book updateBook(@PathParam("isbn") String id, String title);

	@DELETE
	@Path("/book/{isbn}")
	Book removeBook(@PathParam("isbn") String id);
}